import service from "@/service";

//查询【配置功能下拉框】
export function getFlowConfigList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getFlowSelect`,
    method: "GET",
    params,
  });
}

//查询【新增按钮权限】
export function getAddButtonAuth() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/addButtonAuth`,
    method: "GET",
  });
}

//查询【流程配置列表】
export function getTableList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getList`,
    method: "GET",
    params,
  });
}

//删除【节点】
export function getNodeDelete(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/deleteDate`,
    method: "GET",
    params,
  });
}

//查询【表单下拉框】
export function getFormList() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getDataByDictKey`,
    method: "GET",
  });
}

//查询【可打回节点】
export function getBackNodeList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getBackList`,
    method: "GET",
    params,
  });
}

//新增/编辑【节点】
export function saveOrEditNode(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/saveOrEditData`,
    method: "POST",
    data,
  });
}
//查询节点详情
export function getNodeDetail(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getNodeDetail`,
    method: "GET",
    params,
  });
}

//人员配置【保存】
export function saveOrEditUserConfig(data) {
  let { type } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/saveOrEditUserData?type=${type}`,
    method: "POST",
    data,
  });
}

//人员配置【查询已选人员】
export function getUserConfigChoosed(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getNodeUserDetail`,
    method: "GET",
    params,
  });
}

//查询【组织树-人员列表】
export function getOrganizationUserList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getUserList`,
    method: "POST",
    data,
  });
}

//查询【组织树】
export function getOrganizationTreeList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getAllInfoByTenatCode`,
    method: "GET",
    params,
  });
}

//查询【分组-人员列表】
export function getGroupUserList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getGroupUserList`,
    method: "POST",
    data,
  });
}

//查询【分组】
export function getGroupList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/wWorkflownode/getUserGroup`,
    method: "POST",
    data,
  });
}
